package data;

import com.EntityName;
import com.google.appengine.api.datastore.Entity;

public class PayModeMaster extends AbstractData {
	private long id = -1;
	private String title;
	public PayModeMaster()
	{
	}
	public PayModeMaster(long id)
	{
		this.id = id;
	}

	@Override
	public long getId() {
		return id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}

	@Override
	public Entity getEntity() {
		Entity item;
		if(this.key == null)
			item = new Entity(EntityName.PayMode);
		else
			item = new Entity(this.key);

		item.setProperty("title", this.title);
		return item;
	}
	@Override
	public void setEntity(Entity entity) {
		this.id = entity.getKey().getId();
		this.title = (String) entity.getProperty("title");
		
		this.key = entity.getKey();
	}
	public void LoadData() {
		if (this.id > -1) {
			Entity entity = LoadData(EntityName.PayMode, this.id);
			setEntity(entity);
		}
	}
}
